- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 33.6k
benchmark: allow no duration in benchmark tests #13110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Closed
      
      
    
                
     Closed
            
            
          Conversation
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
    
              
                    refack
  
              
              approved these changes
              
                  
                    May 18, 2017 
                  
              
              
            
            
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense
| I think this should probably be prefixed with  | 
Imprecision in process.hrtime() in some situations can result in a zero duration being used as a denominator in benchmark tests. This would almost certainly never happen in real benchmarks. It is only likely in very short benchmarks like the type we run in our test suite to just make sure that the benchmark code is runnable. So, if the environment variable that we use in tests to indicate "allow ludicrously short benchmarks" is set, convert a zero duration for a benchmark to 1 nano-second. Fixes: nodejs#13102
8bf68d5    to
    fb352ae      
    Compare
  
    | 
 @mscdex Sure thing. Updated the PR title and the first line of the commit message as requested. | 
              
                    bnoordhuis
  
              
              approved these changes
              
                  
                    May 19, 2017 
                  
              
              
            
            
              
                    joyeecheung
  
              
              approved these changes
              
                  
                    May 19, 2017 
                  
              
              
            
            
    
  Trott 
      added a commit
        to Trott/io.js
      that referenced
      this pull request
    
      May 22, 2017 
    
    
      
  
    
      
    
  
Imprecision in process.hrtime() in some situations can result in a zero duration being used as a denominator in benchmark tests. This would almost certainly never happen in real benchmarks. It is only likely in very short benchmarks like the type we run in our test suite to just make sure that the benchmark code is runnable. So, if the environment variable that we use in tests to indicate "allow ludicrously short benchmarks" is set, convert a zero duration for a benchmark to 1 nano-second. PR-URL: nodejs#13110 Fixes: nodejs#13102 Fixes: nodejs#12433 Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
| Landed in c3067b5 | 
    
  jasnell 
      pushed a commit
      that referenced
      this pull request
    
      May 23, 2017 
    
    
      
  
    
      
    
  
Imprecision in process.hrtime() in some situations can result in a zero duration being used as a denominator in benchmark tests. This would almost certainly never happen in real benchmarks. It is only likely in very short benchmarks like the type we run in our test suite to just make sure that the benchmark code is runnable. So, if the environment variable that we use in tests to indicate "allow ludicrously short benchmarks" is set, convert a zero duration for a benchmark to 1 nano-second. PR-URL: #13110 Fixes: #13102 Fixes: #12433 Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
    
  jasnell 
      pushed a commit
      that referenced
      this pull request
    
      May 23, 2017 
    
    
      
  
    
      
    
  
Imprecision in process.hrtime() in some situations can result in a zero duration being used as a denominator in benchmark tests. This would almost certainly never happen in real benchmarks. It is only likely in very short benchmarks like the type we run in our test suite to just make sure that the benchmark code is runnable. So, if the environment variable that we use in tests to indicate "allow ludicrously short benchmarks" is set, convert a zero duration for a benchmark to 1 nano-second. PR-URL: #13110 Fixes: #13102 Fixes: #12433 Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
      
        
      
      
  
    3 tasks
  
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
      
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Imprecision in process.hrtime() in some situations can result in a zero
duration being used as a denominator in benchmark tests. This would
almost certainly never happen in real benchmarks. It is only likely in
very short benchmarks like the type we run in our test suite to just
make sure that the benchmark code is runnable.
So, if the environment variable that we use in tests to indicate "allow
ludicrously short benchmarks" is set, convert a zero duration for
a benchmark to 1 nano-second.
Fixes: #13102
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
test benchmark http